import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {

    //除2！
    public static void main2(String[] args) {
        PriorityQueue<Long> priorityQueue = new PriorityQueue<>(new Comparator<Long>() {
            @Override
            public int compare(Long o1, Long o2) {
                return Math.toIntExact((o2-o1));
            }
        });
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        long k = in.nextLong();
        long t,tmp,sum=0;
        long count = 0;

        for (int i = 0; i < n; i++) {
            tmp = in.nextLong();
            if(tmp*2 != 0){
                sum+=tmp;
            }else{
                priorityQueue.offer(tmp);
            }
        }

        if (priorityQueue.isEmpty()){
            System.out.println(sum);
        }else{
            while(true){
                count++;
                if (count > k){
                    break;
                }
                t = priorityQueue.peek();
                priorityQueue.poll();
                t /=2;
                if (t%2 !=0){
                    sum+=t;
                }else{
                    priorityQueue.offer(t);
                }

                if (priorityQueue.isEmpty()){
                    break;
                }
            }

            while(!priorityQueue.isEmpty()){
                t = priorityQueue.poll();
                sum+=t;
            }
            System.out.println(sum);
        }

    }


    //dd爱框框


        public static void main(String[] args) throws IOException
        {
            Read in = new Read();
            int n = in.nextInt(), x = in.nextInt();
            int[] arr = new int[n + 1];
            for (int i = 1; i <= n; i++)
            {
                arr[i] = in.nextInt();
            }

            int left = 1, right = 1, sum = 0;
            int retLeft = -1, retRight = -1, retLen = n;

            while (right <= n)
            {
                // 进窗⼝
                sum += arr[right];
                while (sum >= x)
                {
                    // 更新结果
                    if (right - left + 1 < retLen)
                    {
                        retLeft = left;
                        retRight = right;
                        retLen = right - left + 1;
                    }
                    sum -= arr[left++];
                }
                right++;
            }

            System.out.println(retLeft + " " + retRight);
        }
    }
    class Read // ⾃定义快读 Read
    {
        StringTokenizer st = new StringTokenizer("");
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        String next() throws IOException
        {
            while (!st.hasMoreTokens())
            {
                st = new StringTokenizer(bf.readLine());
            }
            return st.nextToken();
        }

        String nextLine() throws IOException
        {
            return bf.readLine();
        }

        int nextInt() throws IOException
        {
            return Integer.parseInt(next());
        }

        long nextLong() throws IOException
        {
            return Long.parseLong(next());
        }

        double nextDouble() throws IOException
        {
            return Double.parseDouble(next());
        }




    //简写单词
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);

        while (in.hasNext()){
            char ch = in.next().charAt(0);
            if (ch>='a' && ch<='z'){
                ch = (char)(ch-32);
                System.out.print(ch);
            }else{
                System.out.print(ch);
            }
        }

    }
}